from selenium import webdriver


class DriverTools(object):
    __driver = None

    @classmethod
    def get_driver(cls):
        if cls.__driver == None:
            cls.__driver = webdriver.Chrome()
            cls.__driver.maximize_window()
            cls.__driver.implicitly_wait(15)
        return cls.__driver

    @classmethod
    def quit_driver(cls):
        if cls.__driver:
            cls.__driver.quit()
            cls.__driver = None


if __name__ == '__main__':
    DriverTools.get_driver().get("http://hmshop-test.itheima.net/")
    DriverTools.quit_driver()
